<!--
 * @Description: 首页
 * @Author:Huang Xin Ming
 * @Date:2024-11-05 17:03:34
 * @LastEditors:Huang Xin Ming
 * @LastEditTime:2024-11-12 09:15:45
-->

<script setup lang="ts">
import { useNotify } from '@/components/GlobalNotify/index'

const { showNotify } = useNotify()
const notifyClick = (type:string, icon:string, content: string) => {
  showNotify({
    type,
    icon,
    content
  })
}

const goLoginPage = () => {
  uni.navigateTo({
    url: `/pages/login/index?redirect=${encodeURIComponent('/pages/index/index')}`
  })
}
</script>

<template>
  <view class="main">
    <view>
      消息通知
    </view>
    <wd-button size="large" :custom-class="'m-top-20'" block @click="notifyClick('primary','warn-bold','primary')">primary</wd-button>
    <wd-button size="large" :custom-class="'m-top-20'" block @click="notifyClick('success','check-outline','success')" type="success">success</wd-button>
    <wd-button size="large" :custom-class="'m-top-20'" block @click="notifyClick('warning','warn-bold','warning')" type="warning">warning</wd-button>
    <wd-button size="large" :custom-class="'m-top-20'" block @click="notifyClick('danger','close-outline','error')" type="error">error</wd-button>
    <wd-button size="large" :custom-class="'m-top-20'" block @click="notifyClick('primary','loading','loading')">loading</wd-button>
    <view class="m-top-40">
      页面跳转
    </view>
    <wd-button size="large" :custom-class="'m-top-20'" block @click="goLoginPage" type="error">登录</wd-button>
  </view>
</template>

<style lang="scss" scoped>
.main {
  padding: 20rpx;
}
</style>
